<?php

class Ext_Url_Article
{
    public $view;
    public $reply;
    public $publish;
    public $delete;
    
    public function __construct($articleId)
    {
        $this->_build($articleId);
    }
    
    private function _build($articleId)
    {
        $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
        $bootstrap->bootstrap('view');
        $view = $bootstrap->getResource('view');
        
        $articleRow = App_Model_DbTable_Article::getInstance()->getRowById($articleId);
        
        $this->view   = $view->url(array('module'=>'blog', 'controller'=>'article', 'action'=>'view', 'articleId'=>$articleId), "default", true);
        $this->reply  = $view->url(array('module'=>'blog', 'controller'=>'reply', 'action'=>'list', 'articleId'=>$articleId), "default", true);
        $this->edit   = $view->url(array('module'=>'publish', 'controller'=>'article', 'action'=>'show-form', 'articleId'=>$articleId), "default", true);
        $this->delete = $view->url(array('module'=>'publish', 'controller'=>'article', 'action'=>'delete', 'articleId'=>$articleId), "default", true);
    }

}